﻿namespace HZ
{
    /// <summary>
    /// 表别名属性
    /// </summary>
    [global::System.AttributeUsage(System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
    public sealed class TableAttribute : System.Attribute
    {
        readonly string _TableName;
        /// <summary>
        /// 表别名
        /// </summary>
        public string TableName
        {
            get { return _TableName; }
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="tablename">所代替的表名</param>
        public TableAttribute(string tablename)
        {
            _TableName = tablename;
        }
    }

    [global::System.AttributeUsage(System.AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
    public sealed class ColumnAttribute : System.Attribute
    {
        /// <summary>
        /// 是否标示
        /// </summary>
        public bool Identity { get; set; }
        /// <summary>
        /// 是否主键
        /// </summary>
        public bool PrimaryKey { get; set; }
    }
}